package edu.towson.cosc490.incaseofemergency;

import java.util.ArrayList;
import java.util.Arrays;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class FireInformation extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_fire_information);
		
		//create the list view
		ListView fireList;
		fireList = (ListView) findViewById(R.id.listView_FireTips);
		
		//load the list of tips into the the listview
		String[] fireArr = getResources().getStringArray(R.array.fire_tips);
		ArrayList<String> fireArrList = new ArrayList<String>();
		fireArrList.addAll(Arrays.asList(fireArr));
		
		//create an adapter for the listview
		ArrayAdapter<String> fireListAdapter = new ArrayAdapter<String>(this, R.layout.row_fire_information, fireArrList);
		
		//set the array adapter as the listview's adapter
		fireList.setAdapter(fireListAdapter);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.activity_fire_information, menu);
		return true;
	}

}
